using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Zsa.Emulation.Cartridge;

namespace Zsa.Emulation.CNes.UI
{
    public partial class RomBrowserControl : UserControl
    {
        #region Fields
        /// <summary>
        /// The cart selected event.
        /// </summary>
        private event Action<CartridgeFileInfo> _CartSelected;
        #endregion Fields

        #region Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="RomBrowserControl"/> class.
        /// </summary>
        public RomBrowserControl()
        {
            InitializeComponent();
        }
        #endregion Constructor

        #region Methods
        /// <summary>
        /// Refreshes the rom list.
        /// </summary>
        public virtual void RefreshRoms()
        {
        }

        protected void OnCartSelected( CartridgeFileInfo fileInfo )
        {
            if (fileInfo == null)
            {
                return;
            }
            _CartSelected(fileInfo);
        }
        #endregion Methods

        #region Events
        /// <summary>
        /// The cartridge selected event.
        /// </summary>
        public event Action<CartridgeFileInfo> CartSelected
        {
            add
            {
                _CartSelected += value;                
            }
            remove
            {
                _CartSelected -= value;
            }
        }
        #endregion Events

        public virtual object DirectoryKey
        {
            get
            {
                return null;
            }
        }
    }
}
